﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:media="clr-namespace:System.Windows.Media;assembly=PresentationCore"
	xmlns:drawing="clr-namespace:System.Drawing;assembly=System.Drawing"					
    xmlns:local="clr-namespace:PropertyTools.Wpf">

    <!-- CLR & Custom Types Data Templates -->

    <!-- System.Windows.Media.Color -->
    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:PropertyEditor}, ResourceId={x:Type media:Color}}">
        <local:ColorPicker SelectedColor="{Binding Value}"/>
    </DataTemplate>

	<local:DrawingColorToMediaColorConverter x:Key="DrawingColorToMediaColorConverter"/>
	
	<!-- System.Drawing.Color -->
	<DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:PropertyEditor}, ResourceId={x:Type drawing:Color}}">
		<local:ColorPicker SelectedColor="{Binding Value, Converter={StaticResource DrawingColorToMediaColorConverter}}"/>
	</DataTemplate>
    
    <local:BrushToColorConverter x:Key="BrushToColorConverter"/>
    
    <!-- System.Windows.Media.Brush -->
    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:PropertyEditor}, ResourceId={x:Type media:Brush}}">
        <local:ColorPicker SelectedColor="{Binding Value, Converter={StaticResource BrushToColorConverter}}"/>
    </DataTemplate>

    <!-- System.Windows.Media.FontFamily -->
    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:PropertyEditor}, ResourceId={x:Type media:FontFamily}}">
        <ComboBox ItemsSource="{x:Static Fonts.SystemFontFamilies}" SelectedValue="{Binding Value}"/>

        <!-- Alt. 2
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <ComboBox ItemsSource="{x:Static Fonts.SystemFontFamilies}" SelectedValue="{Binding Value}" VerticalAlignment="Top"/>
            <Border BorderBrush="Black" BorderThickness="1" Grid.Column="1" Margin="4 0 0 0" Padding="2">
                <TextBlock Text="{Binding Value}" HorizontalAlignment="Center" FontFamily="{Binding Value}" FontSize="20"/>
            </Border>
        </Grid>
-->

        <!-- Alt 3.        
        <ComboBox Grid.Column="1" ItemsSource="{x:Static Fonts.SystemFontFamilies}" SelectedValue="{Binding Value}" VerticalAlignment="Top">
            <ComboBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding}" FontFamily="{Binding}"/>
                </DataTemplate>
            </ComboBox.ItemTemplate>
        </ComboBox>-->
    </DataTemplate>

    <!-- System.Windows.Media.FontWeight -->
    <!--    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:PropertyEditor}, ResourceId={x:Type media:FontWeights}}">
        <ComboBox ItemsSource="{x:Static Drawing.FontWeights}" SelectedValue="{Binding Value}"/>
    </DataTemplate>
    -->

    <!-- System.Windows.Media.FontStyle -->

</ResourceDictionary>